define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'jizhan.htns_user/index',
        add_url: 'jizhan.htns_user/add',
        edit_url: 'jizhan.htns_user/edit',
        delete_url: 'jizhan.htns_user/delete',
        export_url: 'jizhan.htns_user/export',
        modify_url: 'jizhan.htns_user/modify',
    };
    var Controller = {
    index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', title: 'ID',hide:true, search: 'no'},
                    {field: 'uid', title: 'ID'},
                    {field: 'avatar', title: '用户头像', search: 'no', templet: ea.table.image},
                    {field: 'real_name', title: '姓名'},
                    {field: 'nickname', title: '昵称'},
                    {field: 'jmyc_grade', title: '等级',selectList:gradeList},
                    {field: 'phone', title: '手机号'},
                    {field: 'now_money', title: '余额', search: 'no'},
                    {field: 'integral', title: '积分', search: 'no'},
                    {field: 'spread_user', title: '上级推广人信息'},
                    {field: 'store_info', title: '所在门店',selectList:storeList},
                    {field: 'status', title: '状态', selectList:{0:"关闭",1:"开始"}, templet: ea.table.switch},
                    {field: 'mark', minWidth: 100, title: '备注说明', search: 'no'},
                    {field: 'add_time', minWidth: 120, title: '添加时间', search: 'no'},
                    {width: 250, title: '操作', templet: ea.table.tool, operat: ['edit','delete']}
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});